<%@ page language="java" contentType="text/html; charset=UTF-8" isELIgnored="false"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
    <head>
        <title>添加单证类别</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    


        <script type='text/javascript' src='${pageContext.request.contextPath}/dwr/interface/DocumentGroupDAO.js'></script>

        <script type='text/javascript' src='${pageContext.request.contextPath}/dwr/engine.js'></script>
        <script type='text/javascript' src='${pageContext.request.contextPath}/dwr/util.js'></script>
         <script type="text/javascript" src="${pageContext.request.contextPath}/js/zcms/jquery-1.6.1.min.js"></script>
         <link href="divcss5.css" rel="stylesheet" media="screen" type="text/css" />
        <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/css.css" />
        <script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/document/j.js" ></script>
        <link href="${pageContext.request.contextPath}/css/cont.css" rel="stylesheet" type="text/css"/>
        <script type="text/javascript">
            function getDAO()
            {
            
                DocumentGroupDAO.findAll(callbackgroup);
            }
     
            function callbackgroup(data){  //显示出紧急度
                dwr.util.removeAllOptions("types");
                dwr.util.addOptions("types",{'-1':'--请选择--'});
                dwr.util.addOptions("types",data,"id","name");  
                var a = "<s:property value="property.id" />";
            
                if (typeof(a) != "undefined") 
                {   
                   
                    dwr.util.setValue("types",a);  
                }  
            }
        
            		
            function resetForm() {
                var MyForm = document.getElementById('form');
                MyForm.reset();
            
            }
        </script>
        <style>
            body,td,th{font-size:12px}
            .alllisttitle{ padding-left:10px}
            a:link,a:visited{ color:#000000; text-decoration:none}
            a:hover{ color:#ff0000; text-decoration:none}
            select{ background:#ffffff!important}
        </style>
                <!--单证性质js开始-->
        <script type="text/javascript">
        var menuids1=["suckertree1"]

        function buildsubmenus1(){
            for (var i=0; i<menuids1.length; i++){
                var ultags1=document.getElementById(menuids1[i]).getElementsByTagName("ul")
                for (var t=0; t<ultags1.length; t++){
                    ultags1[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
                    ultags1[t].parentNode.onmouseover=function(){
                        this.getElementsByTagName("ul")[0].style.display="block"
                    }
                    ultags1[t].parentNode.onmouseout=function(){
                        this.getElementsByTagName("ul")[0].style.display="none"
                    }
                }
            }
        }

        if (window.addEventListener)
            window.addEventListener("load", buildsubmenus1, false)
        else if (window.attachEvent)
            window.attachEvent("onload", buildsubmenus1)
        </script>
        <script type="text/javascript">
        function nav1(id){
            if(document.getElementById(id).innerHTML=="所有(清空条件)"){
                document.getElementById('text1').innerHTML="";
                $(".suckertree_ul").css("display","none");
            }
            else
                document.getElementById('text1').innerHTML= document.getElementById(id).innerHTML;
              
               document.getElementById('property.id').value=id;
                $(".suckertree_ul").css("display","none");

        };
        </script>
        <!--单证性质js结束-->
    </head>
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="getDAO()">
        <s:form id="form" name="form" action="%{actionURI}.action" method="post" theme="simple">
            <s:if test="actionURI=='save'">
                <input id="cat.pid" name="cat.pid" type="hidden" value="${pid}"></input>
                <input id="property.id" name="property.id" type="hidden"></input>
                <table width="80%" height="" border="0" cellspacing="1" cellpadding="2" align="center" bgcolor="#b5d6e6">
                    <tr height="28">
                        <td width="12%" align="right" nowrap bgcolor="#deebf1">
                            <b>中文名称：</b>					</td>
                        <td width="37%" bgcolor="#FFFFFF">
                            <s:textfield id="cat.name" name="cat.name" cssStyle="width: 100%"/>	

                        </td>
                    </tr>
                    <tr height="28">
                        <td width="12%" align="right" nowrap bgcolor="#deebf1">
                            <b>编码：</b>					
                        </td>
                        <td width="37%" bgcolor="#FFFFFF">
                            <s:textfield id="cat.userCode" name="cat.userCode" cssStyle="width: 100%"/>	

                        </td>
                    </tr>
                    <tr>
                        <td height="37%" align="right" valign="top" nowrap	bgcolor="#deebf1">
                            <b>所属单证性质:</b>
                        </td>                            
                        <td width="37%">
                            <!--单证性质开始-->
                            <div class="suckerdiv">
                                <ul id="suckertree1">
                                    <li class="suckerdiv_li"><a href="#" id="text1" style=" padding-left:5px;">${property.name}</a>
                                        <ul class="suckertree_ul" style="right:-7px;_right:0px;z-index:0">
                                            <li class="suckertree_ul_li" style="z-index:998"><a href="#" style="z-index:998;width:398px;" id="fonta998" onClick="nav1('fonta998')">所有(清空条件)</a>
                                                <s:iterator value="propertyList" var="c" status="u">
                                                <li class="suckertree_ul_li" style="z-index:-${u.index}"><a href="#" style="z-index:-${u.index}" id="${c.id}" onClick="nav1('${c.id}')">${c.name}</a>

                                                    <ul>
                                                        <s:iterator value="#c.list" var="cc" status="uu">
                                                            <li><a href="#" id="${cc.id}" onClick="nav1('${cc.id}')">${cc.name}</a></li>
                                                        </s:iterator>
                                                    </ul>

                                                </li>
                                            </s:iterator>
                                        </ul>
                                    </li>
                                </ul>
                            </div>
                            <!--单证性质结束-->
                        </td>

                        <!--                    <td width="37%" bgcolor="#FFFFFF">
                                                 <select id="types" name="property.id">        </select>
                                             </td>-->
                        <!--   <td style="padding: 0px; border-bottom: 1px solid buttonface" colspan="3">
                                <iframe frameborder="0" height="250" width="100%" id="iframeRole"
                                        scrolling="yes"	src="${pageContext.request.contextPath }/documentCat/selectProperty.action"></iframe>
                          </td>
                          <td><span style="display: none;"> 
                                  <textarea name="groupIdString" id="documentGroups"><s:property value="documentPropertyList"/></textarea></span>
                          </td>-->
                    </tr>
                    <tr>
                        <td width="12%" align="right" nowrap bgcolor="#deebf1">
                            <b>详细说明：</b>					</td>
                        <td width="39%" bgcolor="#FFFFFF">
                            <s:textfield id="cat.des" name="cat.des" cssStyle="width: 100%"/>
                        </td>
                    </tr>

                </table>
            </s:if>
            <s:else>
                <s:hidden id="cat.id" name="cat.id"></s:hidden>
                <s:hidden id="cat.pid" name="cat.pid"></s:hidden>
                <s:hidden id="cat.code" name="cat.code"></s:hidden>
                   <s:hidden id="property.id" name="property.id"></s:hidden>
                    <table width="80%" height="" border="0" cellspacing="1" cellpadding="2" align="center" bgcolor="#b5d6e6">

                        <tr height="28">
                            <td width="12%" align="right" nowrap bgcolor="#deebf1">
                                <b>中文名称：</b>					</td>
                            <td width="37%" bgcolor="#FFFFFF">
                                <input id="cat.name" name="cat.name" value="<s:property value="cat.name"/>" cssStyle="width: 100%"/>	

                        </td>
                    </tr>
                    <tr height="28">
                        <td width="12%" align="right" nowrap bgcolor="#deebf1">
                            <b>编码：</b>					
                        </td>
                        <td width="37%" bgcolor="#FFFFFF">
                            <input id="cat.userCode" name="cat.userCode" value="<s:property value="cat.userCode"/>" cssStyle="width: 100%"/>	

                        </td>
                    </tr>
                    <tr>
                        <td height="37%" align="right" valign="top" nowrap	bgcolor="#deebf1">
                            <b>所属单证性质:</b>
                        </td>
                                              <td width="37%">
                            <!--单证性质开始-->
                            <div class="suckerdiv">
                                <ul id="suckertree1">
                                    <li class="suckerdiv_li"><a href="#" id="text1" style=" padding-left:5px;">${property.name}</a>
                                        <ul class="suckertree_ul" style="right:-7px;_right:0px;z-index:0">
                                            <li class="suckertree_ul_li" style="z-index:998"><a href="#" style="z-index:998;width:398px;" id="fonta998" onClick="nav1('fonta998')">所有(清空条件)</a>
                                                <s:iterator value="propertyList" var="c" status="u">
                                                <li class="suckertree_ul_li" style="z-index:-${u.index}"><a href="#" style="z-index:-${u.index}" id="${c.id}" onClick="nav1('${c.id}')">${c.name}</a>

                                                    <ul>
                                                        <s:iterator value="#c.list" var="cc" status="uu">
                                                            <li><a href="#" id="${cc.id}" onClick="nav1('${cc.id}')">${cc.name}</a></li>
                                                        </s:iterator>
                                                    </ul>

                                                </li>
                                            </s:iterator>
                                        </ul>
                                    </li>
                                </ul>
                            </div>
                            <!--单证性质结束-->
                        </td>

                    </tr>
                    <tr>
                        <td width="12%" align="right" nowrap bgcolor="#deebf1">
                            <b>详细说明：</b>					</td>
                        <td width="90%" bgcolor="#FFFFFF">
                            <input id="cat.des" name="cat.des" value="<s:property value="cat.des"/>" cssStyle="width: 100%"/>
                        </td>
                    </tr>

                </table>

            </s:else>

            <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr height="28">
                    <td height="30" colspan="4" nowrap="nowrap" bgcolor="#FFFFFF" class="list_btm" style="text-align: center; border: 1">
                        &nbsp;&nbsp;
                        <input type="submit" value=" 保存 " class="mmBtn"/>
                        &nbsp;&nbsp;
                        <input type="button" value=" 重置 " class="mmBtn" onClick="resetForm();"/>
                        &nbsp;&nbsp;
                        <input type="button" value=" 返回 " onClick="window.location='list.action?pid=${pid}&flag=${flag}'" class="mmBtn" /></td>
                </tr></table>

        </s:form>
    </body>
</html>